#include "../src/RecordFile.hpp"
#include "../src/FileFormat/OriginImg.hpp"
#include <iostream>
#include <cstring>

int main()
{
  ImageType img={.frameID=0,.size=11,.data=new unsigned char[12]};
  strcpy((char*)img.data,"Hello World");
  RecordFile rec;
  std::cout<<"Start Test #1"<<std::endl;
  rec.Start(new OriginImg,"testRecord1",{.imgWidth=10,.imgHeight=1,.pixelType=BaseCamera::ImageType::GREY,.CameraUUID="TEST"});
  for(int i=0;i<10;i++)
  {
    rec<<img;
    std::cout<<"Output "<<i<<": "<<rec.GetQueueSize()<<std::endl;
  }
  rec.Stop();
  std::cout<<"Finish Size: "<<rec.GetQueueSize()<<std::endl;
  std::cout<<"Stop Test #1"<<std::endl;
  std::cout<<"Start Test #2"<<std::endl;
  rec.Start(new OriginImg,"testRecord2",{.imgWidth=10,.imgHeight=1,.pixelType=BaseCamera::ImageType::GREY,.CameraUUID="TEST"});
  for(int i=0;i<10;i++)
    rec<<img;
  std::cout<<"Finish Size: "<<rec.GetQueueSize()<<std::endl;
  std::cout<<"Stop Test #2"<<std::endl;
}
